/** This file is part of REMBRANDT - Named Entity Recognition Software
 *  (http://xldb.di.fc.ul.pt/Rembrandt)
 *  Copyright (c) 2008-2009, Nuno Cardoso, University of Lisboa and Linguateca.
 *
 *  REMBRANDT is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  REMBRANDT is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with REMBRANDT. If not, see <http://www.gnu.org/licenses/>.
 */

package rembrandt.io

import rembrandt.obj.NamedEntity

/**
 * @author Nuno Cardoso
 * StyleTags for the HAREM I evaluation contest
 */
class FirstHAREMStyleTag extends StyleTag {
    
    public String printOpenTag(NamedEntity ne) {
        String res = "<"+ne.classification*.category.join("|");
        if (ne.classification*.type) {
            res += " TIPO=\""+ne.classification*.type.join("|");+"\""
        }
        res+=">"
        return res
    }
    
   // TODO
    public NamedEntity parseOpenTag(String tag) {
       return null       
    }
    
    public String printCloseTag(NamedEntity ne) {
        return "</"+ne.classification*.category.join("|")+"> "
    }
    
    public boolean isOpenTag(String tag) {
	return tag.matches(~/<[A-Z\|]+[^>]*?>/) 	
    }
    
    public boolean isCloseTag(String tag) {
	return tag.matches(~/\/<[A-Z\|]+>/) 		
    }
    

    public String printOpenALTTag() {
	return "<ALT>"
    }
    
    public String printCloseALTTag() {
	return "</ALT>"
    }
    
    public String printOpenSubALTTag(int index) {
	return "|"
    }
    
    public String printCloseSubALTTag(int index) {
	return "|"
    }
      
    public boolean isOpenALTTag(String tag) {
        return tag.equals("<ALT>")
    }
    
    public boolean isCloseALTTag(String tag) {
        return tag.equals("</ALT>")
    }
    
    public boolean isOpenSubALTTag(String tag) {
        return tag.equals("|")
    }
    
    public boolean isCloseSubALTTag(String tag) {
        return tag.equals("|")
    }
}